﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>实时交易监控</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible"  content="IE=EmulateIE7"> 
<meta http-equiv="refresh" content="60">
<link rel="stylesheet" type="text/css" href="/static/style.css">

<script src="/static/ccorrect_btn.js"></script>
<script src="/static/MochiKit.js"></script>
<script src="/static/module.js"></script>
<script src="/static/calendar.js" defer></script>

<script>
    function query(){
        var jyrq = document.getElementById("calendar").value;
        var jymc = document.getElementById("calendar").value;
        var shzh = document.getElementById("calendar").value;
        var jyzt = document.getElementById("calendar").value;
        var jgdm = document.getElementById("calendar").value;
        var ywdm = document.getElementById("calendar").value;
        url = '/jyjk/idx/?jyrq='+jyrq+'&jymc='+jymc+'&shzh='+shzh+'&jyzt='+jyzt+'&jgdm='+jgdm+'&ywdm='+ywdm+'&seed='+Math.random();
        window.location.href = url;
    }
</script>
</head>
<body class="bodycolor" topmargin="5">
    <table class="TableBlock" width="100%" align="center">
        <form name='form1' action="" method="get">
            <tr>
                <!--td class="TableContent" align="center" rowspan="2" ><b>操作</b></td-->
                <td class="TableContent" align="center"><b>操作</b></td>
                <td class="TableContent">
                    &nbsp;&nbsp;交易日期
                        <input name="jyrq" id="calendar" type="text" class="SmallInput" value="{{jyrq or ''}}"  style = "width:97px;"/>
                    &nbsp;&nbsp;交易名称<input type="text" name="jymc" class="BigInput" value="{{jymc or ''}}"  style = "width:60px;"/>
                    &nbsp;&nbsp;机构代码<input type="text" name="jgdm" class="SmallInput" value="{{jgdm or ''}}" style = "width:60px;"/>
                    &nbsp;&nbsp;<a href='#' onClick="query()" title="查询实时交易监控"><img src="/static/folder_search.gif" align="absMiddle" border="0">&nbsp;查询</a>&nbsp;&nbsp;

                </td>
            </tr>
            <!--tr>
                <td class="TableContent">
                    第三方账号<input type="text" name="shzh" class="BigInput" value="{{shzh or ''}}" style = "width:120px;"/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;状态<select id="jyzt" name="jyzt" class="SmallSelect" style = "width:133px;">
                                <option value="" >全部</option>
                                <option value="00" {{ 'selected' if jyzt == "00" else '' }}>预计</option>
                                <option value="01" {{ 'selected' if jyzt == "01" else '' }}>成功</option>
                                <option value="10" {{ 'selected' if jyzt == "10" else '' }}>失败</option>
                                <option value="90" {{ 'selected' if jyzt == "90" else '' }}>冲正中</option>
                                <option value="99" {{ 'selected' if jyzt == "99" else '' }}>已冲正</option>
                             </select>
                    业务名称<select id="ywdm" name="ywdm" class="SmallSelect" style = "width:133px;">
                            <option value="" selected>全部</option>
                            %for yw in yw_dic.keys():
                                <option value="{{yw}}" {{ 'selected' if ywdm == yw else '' }}>{{yw_dic.get(yw,yw)}}</option>
                            %endfor    
                             </select>
                    <a href='#' onClick="query()" title="查询实时交易监控"><img src="/static/folder_search.gif" align="absMiddle" border="0">&nbsp;查询</a>&nbsp;&nbsp;
                </td>
            </tr-->
        </form>
    </table>
    <table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
      <tr>
        <td align="right" valign="bottom" class="small1">共<span class="big4">&nbsp;{{ count }}</span>&nbsp;条 </td>
        <td align="right" valign="bottom" class="small1">
            <script language="javascript" type="text/javascript">
            function goto_page(){
                var page_no = parseInt( document.all('page_no').value );
                if( isNaN(page_no) || page_no<1 || page_no>{{ pagecount }} ){
                    alert("页数必须为1-{{ pagecount }}");
                    return false;
                }
                window.location = "/jyjk/idx/?jyrq={{jyrq}}&jymc={{jymc}}&sbbh={{sbbh}}&jgdm={{jgdm}}&shzh={{shzh}}&jyzt={{jyzt}}&ywdm={{ywdm}}&pageno=" + page_no;
            }
            function input_page_no(){
                if(event.keyCode==13) 
                    goto_page();
                if(event.keyCode<47||event.keyCode>57) 
                    event.returnValue=false;
            }
            </script>
            
            <a class="A1" href="/jyjk/idx/?jyrq={{jyrq}}&jymc={{jymc}}&sbbh={{sbbh}}&jgdm={{jgdm}}&shzh={{shzh}}&jyzt={{jyzt}}&ywdm={{ywdm}}&pageno=1">首页</a>&nbsp;
            <a class="A1" href="/jyjk/idx/?jyrq={{jyrq}}&jymc={{jymc}}&sbbh={{sbbh}}&jgdm={{jgdm}}&shzh={{shzh}}&jyzt={{jyzt}}&ywdm={{ywdm}}&pageno={{ pageno-1 if pageno>1 else 1 }}">上一页</a>&nbsp;
            <a class="A1" href="/jyjk/idx/?jyrq={{jyrq}}&jymc={{jymc}}&sbbh={{sbbh}}&jgdm={{jgdm}}&shzh={{shzh}}&jyzt={{jyzt}}&ywdm={{ywdm}}&pageno={{ pageno+1 if pageno<pagecount else pagecount }}">下一页</a>&nbsp;
            <a class="A1" href="/jyjk/idx/?jyrq={{jyrq}}&jymc={{jymc}}&sbbh={{sbbh}}&jgdm={{jgdm}}&shzh={{shzh}}&jyzt={{jyzt}}&ywdm={{ywdm}}&pageno={{ pagecount }}">末页</a>&nbsp;&nbsp;
            第{{ pageno }}页/共{{ pagecount }}页&nbsp;&nbsp;
            页数<input type=text size="3" name="page_no" value='{{ pageno }}' class=SmallInput onKeyPress="input_page_no()" style='text-align:center;'>
            <input type="button" value="转到" class="SmallButton" onClick="goto_page();">&nbsp;
        </td>
      </tr>
    </table>
    <table class="TableList" width="100%">
        <tr class="TableHeader">
            <td nowrap align="center">流水号</td>
            <td nowrap align="center">交易时间</td>
            <td nowrap align="center">交易代码</td>
            <td nowrap align="center">业务名称</td>
            <td nowrap align="center" style="display: none;">机构码</td>
            <td nowrap align="center" style="display: none;">卡号/账号</td>
            <td nowrap align="center" style="display: none;">第三方账号</td>
            <td nowrap align="center" style="display: none;">发生额</td>
            <td nowrap align="center" style="display: none;">方向</td>
            <td nowrap align="center">交易时间(ms)</td>
        </tr>
    
    {%for row in ls_lst %}
        <tr class="TableLine{{ls_lst.index(row)%2}}">
            <td nowrap align="center"><a href="/getlog?lsh={{row['lsh']}}&rq={{jyrq}}&jydm={{row['ywdm']}}">{{row['lsh']}}</a></td>
            <td nowrap align="center">{{row['jysj']}}</td>
            <td nowrap align="center">{{yw_dic.get(row['ywdm'],row['ywdm'])}}</td>
            <td nowrap align="center">{{row['description'].decode('utf-8') }}</td>
            <td nowrap align="center" style="display: none;">{{row['jgdm']or''}}</td>
            <td nowrap style="display: none;">{{row['khzh'] or ''}}</td>
            <td nowrap style="display: none;">{{row['shzh'] or ''}}</td>
            <td nowrap align="right" style="display: none;">{{row['fse'] if row['fse'] or row['fse']==0 else ''}}</td>
            <td nowrap align="center" style="display: none;">
                {% if row['czbz'] == '1'%}
                    <font color='red'>冲正</font>
                {% else%}
                   {{row['czbz'] or ''}}
                {% endif%}
            </td>
            <td nowrap align="center">
            {% if  row['zt'] > 100 %}
            <font color='red'>{{  row['zt'] }}</font>
            {% elif  row['zt'] > 10 %}
            <font color='pink'>{{  row['zt'] }}</font>
            {% else %}
            <font color='green'>{{  row['zt'] }}</font>
            {% endif%}
            </td>
        </tr>
    {%endfor%}
    </table>
</body>
</html>